import hdc_utils
import time
import os


def main():
    devices = hdc_utils.command_devices()
    for device in devices:
        hdc_utils.command_shellcmd(device, "power-shell wakeup")
        hdc_utils.command_shellcmd(device, "power-shell setmode 602")
        hdc_utils.command_persistent_log(device)
        hdc_utils.command_shellcmd(device, "rm -f /data/softbus_tool")
        hdc_utils.command_push(device, "softbus_tool", "/data/")
        hdc_utils.command_shellcmd(device, "chmod +x /data/softbus_tool")

    hdc_utils.timestamp("prepare environment finished")


if __name__ == "__main__":
    main()
